package com.jd.org.domain;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.jd.basic.domain.BaseDomain;
import com.jd.org.vali.Phone;
import com.jd.sys.domain.Role;
import lombok.Data;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import java.util.ArrayList;
import java.util.List;

@Data
public class Employee extends BaseDomain {
    //员工ID
//    private Long id;
    //员工名称
    @NotBlank(message = "员工名称不能为空！")
    private String username;
    //员工电话
    @Phone
    private String phone;
    //员工邮箱
    @Email
    private String email;
    //员工盐值
    private String salt;
    //员工密码
    private String password;
    //员工年龄
    private Integer age;
    //员工状态：1启用 0禁用
    private Integer state = 0; // 入驻默认禁用
    //员工所属部门ID
    private Long departmentId;
    //登录信息ID
    private Long logininfoId;
    //店铺ID：为空=平台系统管理员，不为空=店铺管理员
    private Long shopId;
    // 关联查询
    private Department department; // 所属部门
    private Shop shop; // 所属店铺
    private Long roleId; // 角色id
    private Role role; // 关联查询角色
    // 级联框数据
    @JsonInclude(JsonInclude.Include.NON_EMPTY) // 没有数据就不显示
    private List<Department> children = new ArrayList<>();
    // 店铺入驻确认密码
    private String comfirmPassword;
}